/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lt.cj.core;

import org.lt.cj.config.entities.ConfigModel;

/*
 * @author luohong
 */
public class CrawlingThread extends Thread {

    private Crawler crawler;

    public CrawlingThread(CrawlerThreadGroup group, LinkDB linkDB, ConfigModel configModel) {
        super(group, group.getName());
        crawler = new Crawler(linkDB, configModel);
    }

    @Override
    public void run() {

        crawler.startCrawling();
    }

    public String stopThread() {
        return crawler.stopCrawling();
    }

    public void pause() {
        crawler.setSuspendFlag(true);
    }

    public void resumeCrawler() {
        crawler.resume();
    }
}
